function BPFF_plot_gsx(outputSetting,output,targetPredict,filename)
%{
绘制时间序列图和相关性图并保存。
%}
outputPath=outputSetting.outputPath;
outputName=strcat(outputSetting.outputName,'_',filename);
%% 读取输出的数据
currentPath=cd;
if outputPath=="DefaultPath"
    today=string(datetime('today'));
    folderName=strcat('\result\',today,'\feedForwardNetwork\');   %设置输出文件夹名称为日期
    currentPath=strcat(currentPath,folderName);
else
    currentPath=strcat(currentPath,'\result\',outputPath,'\feedForwardNetwork\');
end
if ~exist(currentPath,'file')   %如果目录下不存在今日文件夹则创建今日文件夹
    mkdir(currentPath)
end
load(strcat(currentPath,outputName));   %加载输出数据

currentPath=strcat(currentPath,'figure\');
if ~exist(currentPath,'file')   %创建保存图像的文件夹
    mkdir(currentPath)
end

%% 绘图
figureFontSize=14;
for i=1:size(output,2)
    %时间序列图
    figure('visible','off');
    set(gcf,'unit','centimeters','position',[18,11.6,19,14.25],'PaperPositionMode','auto');%设置图窗大小和位置
    set(gcf,'color','w');%设置图窗颜色为白色
    xLength=size(output,1);
    plot(1:xLength,targetPredict(1:end,i),'LineWidth',1);
    hold on;
    plot(1:xLength,output(:,i),'LineWidth',1);
    hold off;
    %时间序列图细节设置
    set(gca,'FontName','Times New Roman','FontSize',figureFontSize,'LineWidth',1);
    xlabel('time');
    ylabel('\it{Z}\rm(m)');
    legend('Observed \it{Z}','Predicted \it{Z}');
    set(get(gca,'XLabel'),'FontSize',figureFontSize,'FontName','Times New Roman');
    set(get(gca,'YLabel'),'FontSize',figureFontSize,'FontName','Times New Roman');
    set(get(gca,'Title'),'FontSize',figureFontSize+8,'FontWeight','Bold','FontName','Times New Roman');
    savefig(gcf,strcat(currentPath,outputName,'_timeseries',num2str(i)));
    print(gcf,strcat(currentPath,outputName,'_timeseries',num2str(i)), ...
    '-dpng','-r600');   %保存图片为emf格式
    
    % 相关性图
    figure('visible','off');
    set(gcf,'unit','centimeters','position',[11.88,13,19,11.56],'PaperPositionMode','auto');%设置图窗大小和位置
    set(gcf,'color','w');%设置图窗颜色为白色
    scatter(targetPredict(1:end,i),output(:,i),'LineWidth',1);
    [RMSE,MAE,r2]=evaluationIndexCalculate(targetPredict(1:end,i),output(:,i));    %计算各个评价指标
    annotation_string={['RMSE=' num2str(roundn(RMSE,-3))],...
        ['MAE=' num2str(roundn(MAE,-3))],...
        ['R^2=' num2str(roundn(r2,-3))]};    %设置备注的文本内容,roundn是截取n位小数
    hold on;
    plot([min(targetPredict(1:end,i)) max(targetPredict(1:end,i))],...
        [min(output(:,i)) max(output(:,i))],'--','LineWidth',1);
    % 相关性图细节设置
    set(gca,'FontName','Times New Roman','FontSize',figureFontSize,'LineWidth',1);
    xlabel('Observe Z');
    ylabel('Predict Z');
    annotation('textbox',[0.75 0.35 0.1 0.1], ...
        'String',annotation_string,...
        'FitBoxToText','on',...
        'EdgeColor','none',...
        'FontName','Times New Roman',...
        'FontSize',figureFontSize-2);
    set(get(gca,'XLabel'),'FontSize',figureFontSize,'FontName','Times New Roman');
    set(get(gca,'YLabel'),'FontSize',figureFontSize,'FontName','Times New Roman');
    set(get(gca,'Title'),'FontSize',figureFontSize+8,'FontWeight','Bold','FontName','Times New Roman');
    savefig(gcf,strcat(currentPath,outputName,'_correlation',num2str(i)));
    print(gcf,strcat(currentPath,outputName,'_correlation',num2str(i)), ...
    '-dpng','-r600');
end


end
